package cn.iocoder.yudao.module.erp.dal.mysql.priwarehouseintegra;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.priwarehouseintegra.vo.PriWarehouseIntegraPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.priwarehouseintegra.PriWarehouseIntegraDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * ERP 一级库整合单 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PriWarehouseIntegraMapper extends BaseMapperX<PriWarehouseIntegraDO> {

    default PageResult<PriWarehouseIntegraDO> selectPage(PriWarehouseIntegraPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PriWarehouseIntegraDO>()
                .eqIfPresent(PriWarehouseIntegraDO::getIntegrateId, reqVO.getIntegrateId())
                .eqIfPresent(PriWarehouseIntegraDO::getRemark, reqVO.getRemark())
                .eqIfPresent(PriWarehouseIntegraDO::getOpinion, reqVO.getOpinion())
                .eqIfPresent(PriWarehouseIntegraDO::getStatus, reqVO.getStatus())
                .inIfPresent(PriWarehouseIntegraDO::getProcessInstanceId, reqVO.getProcessInstanceIds())
                .eqIfPresent(PriWarehouseIntegraDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(PriWarehouseIntegraDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PriWarehouseIntegraDO::getId));
    }

}